package ihm;

import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import com.toedter.calendar.JDateChooser;

public class GestionCours extends JFrame implements ActionListener
{

	private JPanel contentPane;
	private JComboBox cbEleve;
	private JComboBox cbChevaux;
	private JDateChooser date;
	private JButton btnRetour;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					GestionCours frame = new GestionCours();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public GestionCours() 
	{
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 500, 370);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblGestionDesCours = new JLabel("Gestion des cours");
		lblGestionDesCours.setBounds(146, 11, 139, 14);
		contentPane.add(lblGestionDesCours);
		
		JLabel lblChoisirUnMoniteur = new JLabel("Choisir un moniteur :");
		lblChoisirUnMoniteur.setBounds(41, 72, 120, 14);
		contentPane.add(lblChoisirUnMoniteur);
		
		JComboBox cbMoniteur = new JComboBox();
		cbMoniteur.setBounds(180, 70, 105, 20);
		contentPane.add(cbMoniteur);
		
		JLabel lblChoisirUneDate = new JLabel("Choisir une date :");
		lblChoisirUneDate.setBounds(41, 110, 115, 14);
		contentPane.add(lblChoisirUneDate);
		
		date = new JDateChooser();
		date.getCalendarButton().setBounds(85, 0, 21, 20);
		date.setBounds(179, 110, 106, 20);
		contentPane.add(date);
		date.setLayout(null);
		
		JLabel lblChoisirUneHeure = new JLabel("Choisir une heure :");
		lblChoisirUneHeure.setBounds(41, 146, 106, 14);
		contentPane.add(lblChoisirUneHeure);
		
		JComboBox cbHeure = new JComboBox();
		cbHeure.setBounds(182, 143, 48, 20);
		contentPane.add(cbHeure);
		
		JLabel lblH = new JLabel("- H -");
		lblH.setFont(new Font("Tahoma", Font.PLAIN, 15));
		lblH.setBounds(240, 144, 40, 14);
		contentPane.add(lblH);
		
		JComboBox cbMinutes = new JComboBox();
		cbMinutes.setBounds(275, 143, 48, 20);
		contentPane.add(cbMinutes);
		
		JLabel lblChoisirEleves = new JLabel("Choisir des \u00E9l\u00E8ves :");
		lblChoisirEleves.setBounds(41, 191, 110, 14);
		contentPane.add(lblChoisirEleves);
		
		JLabel lblChoisirDesChevaux = new JLabel("Choisir des chevaux :");
		lblChoisirDesChevaux.setBounds(41, 239, 132, 14);
		contentPane.add(lblChoisirDesChevaux);
		
		JButton btnValider = new JButton("Valider");
		btnValider.setBounds(385, 285, 90, 20);
		contentPane.add(btnValider);
		
		btnRetour = new JButton("Retour");
		btnRetour.addActionListener(this);
		btnRetour.setBounds(275, 285, 90, 20);
		contentPane.add(btnRetour);
		
		cbEleve = new JComboBox();
		cbEleve.setBounds(180, 188, 105, 20);
		contentPane.add(cbEleve);
		
		cbChevaux = new JComboBox();
		cbChevaux.setBounds(180, 236, 105, 20);
		contentPane.add(cbChevaux);
	}

	@Override
	public void actionPerformed(ActionEvent evt) 
	{
		if(evt.getSource() == btnRetour)
			this.dispose();		
	}
}
